// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.core;

public class BoxedStaticValues {
    static Double[] doubles = new Double[10000];
    static Double[] negdoubles = new Double[10000];
    static Double[] doublesh = new Double[10000];
    static Double[] negdoublesh = new Double[10000];

    public static Double toDouble(double d) {
        if (d >= 10000.0) {
            return d;
        } else if (d <= -10000.0) {
            return d;
        } else if ((double)((int)Math.abs(d)) == Math.abs(d)) {
            return d < 0.0 ? negdoubles[(int)(-d)] : doubles[(int)d];
        } else if ((double)((int)Math.abs(d)) == Math.abs(d) - 0.5) {
            return d < 0.0 ? negdoublesh[(int)(-d)] : doublesh[(int)d];
        } else {
            return d;
        }
    }

    static {
        for (int _int = 0; _int < 10000; _int++) {
            doubles[_int] = (double)_int;
            negdoubles[_int] = -doubles[_int];
            doublesh[_int] = (double)_int + 0.5;
            negdoublesh[_int] = -(doubles[_int] + 0.5);
        }
    }
}
